package com.xbenben.demoroot.controller;

import com.alibaba.fastjson.JSONObject;
import com.xbenben.demoroot.bean.UserLog;
import com.xbenben.demoroot.service.RegSyncService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;

@RestController
@CrossOrigin
@RequestMapping("/sync")
@Slf4j
public class SyncController {

    @Autowired
    private RegSyncService  regSyncService;

    @GetMapping("/sync1")
    public String reguser1(){
        log.info("---------注册用户---------");
        // 异步发送消息


        regSyncService.sendMsg();
        log.info("---------注册成功---------");
        return "ok";
    }
    @GetMapping("/sync2")
    public String reguser2(){
        log.info("---------注册用户---------");
        // 异步添加积分
        regSyncService.addScore();
        return "ok";
    }



}
